# Copyright (C) 2018 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#      http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
load("@io_bazel_rules_go//proto:def.bzl", "go_proto_library")
load("@rules_proto//proto:defs.bzl", "proto_library")

go_library(
    name = "go_default_library",
    srcs = [
        "as.go",
        "command_tree.go",
        "commands.go",
        "constant_set.go",
        "delete.go",
        "doc.go",
        "errors.go",
        "events.go",
        "filter.go",
        "find.go",
        "follow.go",
        "framebuffer_attachment.go",
        "framebuffer_attachment_data.go",
        "framebuffer_changes.go",
        "framebuffer_observation.go",
        "get.go",
        "index_limits.go",
        "memory.go",
        "mesh.go",
        "metrics.go",
        "report.go",
        "resolve.go",
        "resource_data.go",
        "resource_meta.go",
        "resources.go",
        "service.go",
        "set.go",
        "state.go",
        "state_tree.go",
        "stats.go",
        "synchronization_data.go",
        "thumbnail.go",
    ],
    embed = [":resolve_go_proto"],
    importpath = "github.com/google/gapid/gapis/resolve",
    visibility = ["//visibility:public"],
    deps = [
        "//core/app/analytics:go_default_library",
        "//core/app/status:go_default_library",
        "//core/data/deep:go_default_library",
        "//core/data/dictionary:go_default_library",
        "//core/data/endian:go_default_library",
        "//core/data/id:go_default_library",
        "//core/data/protoutil:go_default_library",
        "//core/event/task:go_default_library",
        "//core/fault:go_default_library",
        "//core/image:go_default_library",
        "//core/log:go_default_library",
        "//core/math/interval:go_default_library",
        "//core/math/sint:go_default_library",
        "//core/math/u64:go_default_library",
        "//core/memory/arena:go_default_library",
        "//core/os/device:go_default_library",
        "//core/os/device/bind:go_default_library",
        "//core/stream/fmts:go_default_library",
        "//gapis/api:go_default_library",
        "//gapis/api/sync:go_default_library",
        "//gapis/capture:go_default_library",
        "//gapis/database:go_default_library",
        "//gapis/memory:go_default_library",
        "//gapis/messages:go_default_library",
        "//gapis/replay:go_default_library",
        "//gapis/replay/devices:go_default_library",
        "//gapis/resolve/cmdgrouper:go_default_library",
        "//gapis/resolve/initialcmds:go_default_library",
        "//gapis/service:go_default_library",
        "//gapis/service/box:go_default_library",
        "//gapis/service/memory_box:go_default_library",
        "//gapis/service/path:go_default_library",
        "//gapis/service/types:go_default_library",
        "//gapis/stringtable:go_default_library",
        "//gapis/trace:go_default_library",
    ],
)

go_test(
    name = "go_default_test",
    size = "small",
    srcs = [
        "delete_test.go",
        "get_set_test.go",
        "requests_test.go",
        "state_tree_test.go",
    ],
    embed = [":go_default_library"],
    deps = [
        "//core/assert:go_default_library",
        "//core/data/id:go_default_library",
        "//core/log:go_default_library",
        "//core/memory/arena:go_default_library",
        "//core/os/device:go_default_library",
        "//core/os/device/bind:go_default_library",
        "//gapis/api:go_default_library",
        "//gapis/api/test:go_default_library",
        "//gapis/capture:go_default_library",
        "//gapis/database:go_default_library",
        "//gapis/memory:go_default_library",
        "//gapis/messages:go_default_library",
        "//gapis/service:go_default_library",
        "//gapis/service/box:go_default_library",
        "//gapis/service/path:go_default_library",
    ],
)

proto_library(
    name = "resolve_proto",
    srcs = ["resolvables.proto"],
    visibility = ["//visibility:public"],
    deps = [
        "//core/image:image_proto",
        "//gapis/api:api_proto",
        "//gapis/service:service_proto",
        "//gapis/service/path:path_proto",
    ],
)

go_proto_library(
    name = "resolve_go_proto",
    importpath = "github.com/google/gapid/gapis/resolve",
    proto = ":resolve_proto",
    visibility = ["//visibility:public"],
    deps = [
        "//core/image:go_default_library",
        "//gapis/api:go_default_library",
        "//gapis/service:go_default_library",
        "//gapis/service/path:go_default_library",
    ],
)
